import {
    _get,
    _post
} from '../../utils/request'
import util from '../../utils/util'
const app = getApp()
Page({
    data: {
        active: false,
        list: [
            // {
            //     name: "安全防范工程技术标准",
            //     company: "九链",
            //     release_time: "2021-12-8",
            //     do_time: "2021-12-9",
            // },
            // {
            //     name: "安全防范工程技术标准",
            //     company: "九链",
            //     release_time: "2021-12-8",
            //     do_time: "2021-12-9",
            // },
            // {
            //     name: "安全防范工程技术标准",
            //     company: "九链",
            //     release_time: "2021-12-8",
            //     do_time: "2021-12-9",
            // },
        ],
    },
    open_pdf(e) {
        console.log(e);
        this.setData({
            active: true,
            pdf_src: e.target.dataset.src
        })
    },
    search(e) {
        this.getStandard(e)
    },
    getStandard(keywords = '') {
        let params = {
            standardName: keywords
        }
        _get(`/standard/selectOrByName`, params).then(res => {
            console.log('标准库', res.data);
            this.setData({
                list: res.data
            })
        })
    },
    onShow() {
        this.setData({
            active: false
        })
    },
    onLoad() {
        dd.setNavigationBar({
            title: '标准库',
            backgroundColor: '#142e4f',
            success() {},
            fail() {},
        });
        this.getStandard()
    },
});